package com.google.guava.eventbus.service;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;
import com.google.common.eventbus.EventBus;
import com.google.common.eventbus.Subscribe;
import com.google.guava.eventbus.events.Request;
import com.google.guava.eventbus.events.Response;

/**
 * @author fuc
 * @create 2020-10-06
 */
public class RequestQueryHandler {
  private static final Log log = LogFactory.get();

  private final EventBus eventBus;

  public RequestQueryHandler(EventBus eventBus) {
    this.eventBus = eventBus;
  }

  @Subscribe
  public void doQuery(Request request) {
    log.info("start query the orderNo [{}]", request.toString());
    Response response = new Response();
    this.eventBus.post(response);
  }
}
